package com.xzj.getway.init;

import com.xzj.getway.service.DynamicRouteServiceImpl;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * @program: xzj-admin
 * @ClassName: GatewayInitHandle
 * @description: 初始化操作
 * @author: XiaZunJun
 * @create: 2024-10-16 11:21
 */
@Slf4j
@Component
public class GatewayInitHandle implements ApplicationRunner {

    @Resource
    private DynamicRouteServiceImpl dynamicRouteService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        dynamicRouteService.refreshAll();
    }
}
